package com.ngc.mall.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ngc.mall.common.configure.mybatisPlus.BaseServiceImpl;
import com.ngc.mall.domain.FreightTemplateDomain;
import com.ngc.mall.mapper.FreightTemplateMapper;
import com.ngc.mall.service.IFreightTemplateService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * 运费模板实现类
 * @author: chenxiaolin
 * @date 2023/11/6 13:58
**/
@Service
public class FreightTemplateServiceImpl extends BaseServiceImpl<FreightTemplateMapper, FreightTemplateDomain> implements IFreightTemplateService {

    @Override
    public List<FreightTemplateDomain> queryAll(){
        return super.list(Wrappers.<FreightTemplateDomain>lambdaQuery().orderByDesc(FreightTemplateDomain::getCreateTime));
    }

    @Override
    public Long createFreightTemplate(FreightTemplateDomain domain){
        return  super.create(domain);
    }

    @Override
    public Boolean updateById(Long id,FreightTemplateDomain domain){
        return super.update(domain, Wrappers.<FreightTemplateDomain>lambdaQuery().eq(FreightTemplateDomain::getId,id));
    }

    @Override
    public Boolean deleteById(Long id){
        return super.removeById(id);
    }
}
